SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE PROCEDURE [dbo].[Movie_Insert_NewMovies]
@FileName VARCHAR(200), @Title VARCHAR(150), @Plot VARCHAR(MAX), @Directors VARCHAR(150),
@Year VARCHAR(10), @Rating FLOAT, @SaveLocation VARCHAR(MAX), @Type VARCHAR(50)
AS
IF NOT EXISTS(SELECT MovieTitle FROM dbo.Media_Movie WHERE MovieTitle = @Title)
	BEGIN
	INSERT INTO dbo.Media_Movie
				(	
					[FileName], 
					MovieTitle, 
					[Description], 
					Director, 
					[ReleaseDate], 
					Rating, 
					[Image]
				)
		VALUES	( 
					@FileName,
					@Title, 
					@Plot, 
					@Directors, 
					@Year, 
					@Rating, 
					@SaveLocation
				)
END
SELECT 'Add Successfully'
GO
